import {Tree} from 'antd';
import React from 'react';

const {TreeNode, DirectoryTree} = Tree;

export default class Demo extends React.Component {

  render() {
    return (
      <DirectoryTree multiple defaultExpandAll onSelect={(keys, event) => {
        console.log('Trigger Select', keys, event)
      }} onExpand={console.log('Trigger Expand')}>
        <TreeNode title="第一章" key="0-0">
          <TreeNode title="第1节" key="0-0-0" isLeaf/>
          <TreeNode title="第2节" key="0-0-1" isLeaf/>
        </TreeNode>
        <TreeNode title="第二章" key="0-1">
          <TreeNode title="第1节" key="0-1-0" isLeaf/>
          <TreeNode title="第2节" key="0-1-1" isLeaf/>
          <TreeNode title="第3节" key="0-1-1" isLeaf/>
          <TreeNode title="第4节" key="0-1-1" isLeaf/>
        </TreeNode>
        <TreeNode title="第三章" key="0-2">
          <TreeNode title="第1节" key="0-2-0" isLeaf/>
          <TreeNode title="第2节" key="0-2-1" isLeaf/>
        </TreeNode>

      </DirectoryTree>
    );
  }
}
